const path = require('path');

module.exports = {
  devtool: 'eval-source-map',
  entry: path.join(__dirname, 'src/index.js'),
  output: {
    filename: 'ju.js'
  },
  devServer: {
    contentBase: path.join(__dirname, "src"),
    inline: true,
    open: true,
    openPage: 'index.html',
    stats: "errors-only",
    hot: true,
    hotOnly: true
  },
  module: {
    rules: [{
      test: /\.js$/,
      exclude: /node_modules/,
      loader: "babel-loader"
    }, {
      test: /\.styl$/,
      use: [
        { loader: 'style-loader', options: { sourceMap: true } },
        { loader: 'css-loader', options: { sourceMap: true } },
        { loader: 'postcss-loader', options: { sourceMap: true } },
        { loader: 'stylus-loader', options: { sourceMap: true } }
      ]
    }, {
      test: /\.css$/,
      loader: "style-loader!css-loader"
    }]
  },
  plugins: []
}
